import request from '@/utils/request'

// 查询参数列表
export function listConfig(query) {
  return request({
    url: '/system/gov/type/list',
    method: 'post',
    data: query
  })
}

// 查询参数详细
export function getConfig(configId) {
  return request({
    url: '/system/config/' + configId,
    method: 'get'
  })
}

// 根据参数键名查询参数值
export function getConfigKey(configKey) {
  return request({
    url: '/system/config/configKey/' + configKey,
    method: 'get'
  })
}

// 新增参数配置
export function addConfig(data) {
  return request({
    url: '/system/config',
    method: 'post',
    data: data
  })
}

// 修改参数配置
export function updateConfig(data) {
  return request({
    url: '/system/config',
    method: 'put',
    data: data
  })
}

// 删除参数配置
export function delConfig(configId) {
  return request({
    url: '/system/config/' + configId,
    method: 'delete'
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/system/config/refreshCache',
    method: 'delete'
  })
}

// 查询政务云配置列表
export function listGovList(query) {
  return request({
    url: '/system/gov/manager/list',
    method: 'post',
    data: query
  })
}

// 新增政务云配置
export function addGov(data) {
  return request({
    url: '/system/gov',
    method: 'post',
    data: data
  })
}

// 修改政务云配置
export function updateGov(data) {
  return request({
    url: '/system/gov',
    method: 'put',
    data: data
  })
}

// 删除政务云配置
export function delGov(data) {
  return request({
    url: '/system/gov/batchDelete',
    method: 'post',
    data: data
  })
}

// 查询网站信息
export function webConfig(params) {
  return request({
    url: '/system/setting/list',
    method: 'get',
    params: params
  })
}

// 网站信息修改
export function webConfigUpdate(data) {
  return request({
    url: '/system/setting/update',
    method: 'post',
    data: data
  })
}

// 获取区域列表
export function govAreaList(params) {
  return request({
    url: '/system/gov/area',
    method: 'get',
    params: params
  })
}

// 查询公有云配置列表
export function listPublicList(query) {
  return request({
    url: '/system/common/manager/list',
    method: 'post',
    data: query
  })
}

// 新增公有云配置
export function addPublic(data) {
  return request({
    url: '/system/common',
    method: 'post',
    data: data
  })
}

// 修改公有云配置
export function updatePublic(data) {
  return request({
    url: '/system/common',
    method: 'put',
    data: data
  })
}

// 删除公有云配置
export function delPublic(data) {
  return request({
    url: '/system/common/batchDelete',
    method: 'post',
    data: data
  })
}

// 获取区域列表
export function govPublicAreaList(params) {
  return request({
    url: '/system/common/area',
    method: 'get',
    params: params
  })
}

export function listPublicConfig(query) {
  return request({
    url: '/system/common/type/list',
    method: 'post',
    data: query
  })
}